import java.util.List;

public class Dealer {
	public static boolean isHit(List<P> pList) {
		if (count(pList) >= 17) {
			return false;
		} else {
			return true;
		}

	}

	public static int count(List<P> pList) {
		int count = 0;
		boolean hasA = false;
		for (P p : pList) {
			if (p.getNum() == 14) {
				count = count + 1;
				hasA = true;
			} else if (p.getNum() >= 10) {
				count = count + 10;
			} else {
				count = count + p.getNum();
			}
		}

		if (hasA && count <= 11) {
			count = count + 10;
		}
		return count;
	}
}
